from fastapi import APIRouter,File,UploadFile

docsRouter=APIRouter(prefix='/docs2pdf',tags=['文件转换'])


@docsRouter.post("/files/")
async def creat_file(file:bytes=File(...)):
    return {"file_size": len(file)}

@docsRouter.post("/uploadfile/")
async def create_upload_file(file: UploadFile):
    return {"filename": file.filename}